<?php
require_once("../application.php");

$via = $_REQUEST["via"];
// 保存登录的当前网页
$_SESSION['url_before_login'] = $_SERVER["HTTP_REFERER"];

require_once(ROOT_DIR."/classes/LSync.class.php");
if("sina" == $via){
	$callbackUrl = ROOT_URL.'server/sync_callback.php?web=sina';
	$url = LSync::MakeAuthUrl('sina', $callbackUrl);
}else if("renren" == $via){
	$callbackUrl = ROOT_URL.'server/sync_callback.php?web=renren';
	$url = LSync::MakeAuthUrl('renren', $callbackUrl);
}
header("Location: {$url}");
//echo $url;